'use strict';

module.exports = app => {
    const {DataTypes} = app.Sequelize;
    const RoomHistory = app.model.define('room_history', {
        id: { type: DataTypes.UUID,defaultValue: app.Sequelize.UUIDV4, primaryKey: true,notNull: true,comment: 'ID'},
        room_id: {
            type: DataTypes.UUID,
            notNull: true,
            comment: '房间ID'
        },
        person_num: {
            type: DataTypes.INTEGER,
            notNull: true,
            defaultValue:1,
            min: 1,
            max: 15,
            comment: '玩家人数'
        },
        winer_id: {
            type: DataTypes.UUID,
            comment: '用户ID'
        },
        winer_role: {
            type: DataTypes.INTEGER,
            comment: '角色(狼人,预言家..)'
        },
    },
    {
        timestamps: false
    }
  );
  return RoomHistory;
};